﻿<div style="text-align: center">
    <MButton Color="error"
             OnClick="OnClick"
             OnClickStopPropagation>
        Show Overlay
    </MButton>

    <MOverlay Value="_overlay"></MOverlay>
</div>

@code {
    bool _overlay;

    private async Task OnClick(MouseEventArgs args)
    {
        _overlay = true;
        StateHasChanged();

        await Task.Delay(2000);
        _overlay = false;
    }

}
